home *** CD-ROM | disk | FTP | other *** search
/ Ahoy 1987 March / Ahoy_Magazine_87-03_1987_Double_L.d64 / Digit Decomp. (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  384b  |  14 lines

  1. 0 print"[147]"tab(10)"digital decomposition[146]":poke53280,0:poke53281,0:poke646,1
  2. 1 rem commodares problem #34-3:
  3. 2 rem    digit decomposition
  4. 3 rem solution by
  5. 4 rem    necah buyukdura
  6. 5 rem
  7. 10 ct=208 : bf=842 :rem c-128 kbd buffer
  8. 20 if ds$="" then ct=198 : bf=631 :rem   c-64 kbd buffer
  9. 30 poke ct,0 : wait ct,1
  10. 40 d=peek(bf)-48 : print d; : s=s+d
  11. 50 poke ct,0 : wait ct,1
  12. 60 if peek(bf)<>13 then print "+";: goto 40
  13. 70 print "=" s
  14.